﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.ServiceModel;
using System.ServiceModel.Channels;
using y.WcfFirst.ClientChannel.Proxy;
namespace y.WcfFirst.ClientChannel
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.Title = "y.WcfFirst.ClientChannel";
            Console.WriteLine("Please input your name:");
            string name = string.Empty;
            while (true)
            {
                name = Console.ReadLine();
                if (name.Equals("exit"))
                {
                    Environment.Exit(0);
                }
                ChannelFactory<IHello> factory = new ChannelFactory<IHello>("wcfFirst");
                IHello channelProxy = factory.CreateChannel();
                using(channelProxy as IDisposable)
                {
                    Console.WriteLine("Recevie from Server:{0}", channelProxy.Say(name));
                }
            }
        }
    }
}
